package cn.edu.njnu.opengmpback.user.service;


import cn.edu.njnu.opengmpback.common.utils.JsonResult;
import cn.edu.njnu.opengmpback.user.entity.UserEntity;
import com.alibaba.fastjson.JSONObject;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

public interface UserService {
    JsonResult registerService(UserEntity user);


    String getIpAddr(HttpServletRequest request);

    JsonResult loginAndAcquireInfo(String email, String password, String ipAddr);

    Object getUserInfoByToken(String substring);

    JsonResult sendResetPwdEmail(String email);

    JsonResult resetPwdByCode(String email, String code, String newPwd);

    JsonResult resetPwdByOldPwd(String oldPwd, String newPwd, HttpServletRequest request);

    Object userState(HttpServletRequest req);

    JsonResult uploadAvatar(HttpServletRequest req) throws IOException, ServletException;

    JsonResult updateUserInfo(JSONObject user, HttpServletRequest request);

    JsonResult getProjectAndDataNumByUserId(String userId);

    JsonResult refreshToken(String refreshToken);
}
